import java.util.Arrays;
import java.util.Scanner;

public class Test{
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        int n = in.nextInt();
        int[] arr = new int[3*n];
        for(int i = 0;i<3*n;i++){
            arr[i] = in.nextInt();
        }
        for(int i=0;i<3*n-1;i++){
            for(int j= 0;j<3*n-1-i;j++){
                if(arr[j]>arr[j+1]){
                    int tmp;
                    tmp= arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = tmp;
                }
            }
        }
        if(n==1){
            System.out.print(arr[1]);
        }
        else {
            int t = 0;
            for(int i = 0;i<n;i++){
                t += arr[3*n-n-1-i];
            }
            System.out.print(t);
        }

    }
}
